import {request} from '../../request'

// 基础接口

//获取年度列表
function getYears(unitId) {
    return request("GET", '/api/base/years/no_auth',{unitId:unitId})
};

//获取学期列表
function getTerms(unitId,yearValue) {
    return request("GET", '/api/base/term/no_auth',{unitId:unitId, year:yearValue})
};

//获取班级列表
function getClazzes(params) {
    return request("GET", '/api/base/clazz',params)
};

//获取节次
function getFestival(params) {
    return request("GET", '/api/base/festival',params)
};

//排课接口

//获取列表
function getTable(params) {
    if(params.flag) {
        return request("POST", '/api/pk/sheet/class_sheet',params)
    } else {
        return request("POST", '/api/pk/sheet/teacher_sheet',params)
    }
};

//根据年级查课程
function getCourses(params) {
    return request("POST", '/api/pk/sheet/course_list',params)
};

//根据课程查教师
function getTeachers(params) {
    return request("POST", '/api/pk/sheet/teacher_list',params)
};

//获取年级列表
function getGrades(params) {
    return request("GET", '/api/pk/solution/select_pk_grade_by_term_and_type',params)
};

export default {
    getYears,
    getTerms,
    getGrades,
    getClazzes,
    getFestival,
    getTable,
    getCourses,
    getTeachers
}